Skip to content

Probe /dev/tty by opening it, not by testing permission bits - #5

Merged
BeLazy167 merged 1 commit into
mainfrom
fix/tty-probe
Aug 20, 2026
Merged

Probe /dev/tty by opening it, not by testing permission bits#5
BeLazy167 merged 1 commit into
mainfrom
fix/tty-probe

Conversation

@BeLazy167

Copy link
Copy Markdown
Member

Found during the local delete-and-reinstall pass. [ -r /dev/tty ] passes in environments where the device exists but cannot be opened (open fails with 'Device not configured'), so the installer tried to prompt anyway — three open errors and a retry loop instead of the clean 'no terminal available for input. Set QBRAID_API_KEY and re-run.' message.

Verified both directions locally: under a real pty (script(1)) the probe yields /dev/tty so interactive prompts still work; with the unopenable device it yields empty and the installer exits with the instruction. All local suites pass: shellcheck, bash 3.2 parse, statusline 12/12, extractors 5/5.

[ -r /dev/tty ] passes in environments where the device exists but cannot be
opened (macOS reports 'Device not configured' only on open). The installer
then tried to prompt anyway: three open errors and a retry loop instead of
the clean 'no terminal — set QBRAID_API_KEY and re-run' message.

Verified both directions: under a real pty (script(1)) the probe yields
/dev/tty; with the unopenable device it yields empty and the installer dies
with the instruction.
@BeLazy167
BeLazy167 merged commit 281fdb2 into main Aug 20, 2026
6 checks passed
@BeLazy167
BeLazy167 deleted the fix/tty-probe branch August 20, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant